package cn.net.chenbao.medical;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import cn.net.chenbao.medical.api.Api;

public class EditHostActivity extends AppCompatActivity {
    private EditText mEtHost;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_host);
        mEtHost= (EditText) findViewById(R.id.et_host);
        findViewById(R.id.tv_ok).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MedicalApplication.getInstance().setHostAddress(TextUtils.isEmpty(mEtHost.getText().toString())?null:"http://"+mEtHost.getText().toString());
                finish();
            }
        });
    }
}
